package com.fang.thread1;
//如果不想成为一个线程，可以直接实现Runnable
public class MyThread02 implements Runnable {
    @Override
    public void run() {
        for (int i = 0; i <10 ; i++) {
            System.out.println(i+":"+"MyThread02");
            try {
                if(i==3){
                    Thread.yield();
                }
                Thread.sleep(1000);
            } catch (InterruptedException e) {
                e.printStackTrace();
            }
        }
    }
}
